﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Flattiverse;

namespace flattiverse
{
    static class Chat
    {
        static private Connector connector;

        static public Connector _connector
        {
            set
            {
                connector = value;
            }
            get
            {
                return connector;
            }
        }
        //static private string sendMessage
        //{
        //    get
        //    {
        //        return sendMessage;
        //    }
        //    set
        //    {
        //        sendMessage = value;
        //    }
        //}
        static private string receiveMessage;
       static public string _receiveMessage
        {
            get
            {
                return receiveMessage;
            }
            set
            {
                receiveMessage = value;
            }
        }

        public static void sendMsg(string sendMessage)
        {
           if (connector.Account.UniverseGroup != null) 
           {
               connector.Account.UniverseGroup.Chat(sendMessage);
           }
            sendMessage = "";
        }
        public static void receiveMsg()
        {
            Message _receiveMsg;
            if (connector.NextMessage(out _receiveMsg) != false)
            {
                while (connector.NextMessage(out _receiveMsg))
                {
                    receiveMessage = _receiveMessage.ToString();
                }
            }
        }
   
    }
}
